﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using System.ComponentModel;

using System.ComponentModel.Composition;

namespace ETRobocon.RaceTraking.GamePresentation
{
    /// <summary>
    /// UserControlClearMark.xaml の相互作用ロジック
    /// </summary>
    public partial class UserControlClearMark : UserControl, IClearMarkEffectView
    {
        public UserControlClearMark()
        {
            InitializeComponent();
        }

        public string MarkerName { get; set; }

        public void ClearMark1Visibility(bool on)
        {
            if (on)
            {
                this.ClearedMark1.Visibility = Visibility.Visible;
            }
            else
            {
                this.ClearedMark1.Visibility = Visibility.Hidden;
            }
        }
        public void ClearMark2Visibility(bool on)
        {
            if (on)
            {
                this.ClearedMark2.Visibility = Visibility.Visible;
            }
            else
            {
                this.ClearedMark2.Visibility = Visibility.Hidden;
            }
        }

        public void Reset()
        {
            this.ClearMark1Visibility(false);
            this.ClearMark2Visibility(false);
        }

        public void MoveTop(int delta)
        {
            Canvas.SetTop(this, Canvas.GetTop(this) + delta);
        }

        public void MoveLeft(int delta)
        {
            Canvas.SetLeft(this, Canvas.GetLeft(this) + delta);
        }

        #region IClearMarkEffectView Members

        public void Fire(int level, bool on)
        {
            switch (level)
            {
                case 1:
                    this.ClearMark1Visibility(on);
                    break;
                case 2:
                    this.ClearMark2Visibility(on);
                    break;
            }
        }

        #endregion
    }

}
